﻿using Application.Permissions.Interfaces;
using Domain.Roles.Interfaces;

namespace Infrastructure.Services
{
    public class JsonPermissionRegistry(IPermissionService service) : IPermissionRegistry
    {
        public bool IsExist(string permissionSign)
        {
            return service.IsValidSign(permissionSign);
        }

        public IEnumerable<string> NonExistSigns(params string[] signs)
        {
            foreach (var sign in signs)
            {
                if(!service.IsValidSign(sign))
                    yield return sign;
            }
        }

    }
}
